//
//  SKRootCellTableViewCell.m
//  sc
//
//  Created by 趣看 on 14-7-17.
//  Copyright (c) 2014年 SeeKool Inc. All rights reserved.
//

#import "SKRootCellTableViewCell.h"
#import "UIColor+Hex.h"

@implementation SKRootCellTableViewCell

@synthesize labelView,iconView,bottomLine,topLine;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    
    if (self) {
       
        [self initSubView];
    }

    
    return self;
}

#pragma mark - 初始化子视图
- (void)initSubView
{
    
    NSLog(@"self.view : %@",NSStringFromCGRect(self.frame));
    CGRect cellFrame = self.frame;
   
    if (labelView == nil)
    {
        labelView = [[UILabel alloc] init];
    }
    if (iconView == nil)
    {
        iconView = [[UIImageView alloc] init];
    }
    if (bottomLine == nil)
    {
        bottomLine = [[UILabel alloc] init];
    }
    if (topLine == nil)
    {
        topLine = [[UILabel alloc] init];
    }
    
    self.selectedBackgroundView = [[UIView alloc] initWithFrame:cellFrame];
    [self.selectedBackgroundView setBackgroundColor:[UIColor colorWithHexString:@"1c2127"]];
    [self sendSubviewToBack:self.selectedBackgroundView];
    
    
    labelView.backgroundColor = [UIColor clearColor];
    labelView.textColor = [UIColor whiteColor];
    
    [topLine     setFrame:CGRectMake(0, 1, 340, 2)];
    [bottomLine  setFrame:CGRectMake(0, 3, 340, 2)];
    
    
    [topLine     setBackgroundColor:[UIColor colorWithHexString:@"3B424C"]];
    [bottomLine  setBackgroundColor:[UIColor colorWithHexString:@"20242B"]];
    
    [labelView setFrame:CGRectMake(85, 18, 100, 28)];
    [iconView  setFrame:CGRectMake(45, 18, 28,28)];
    
    
    
    [self addSubview:labelView];
    [self addSubview:iconView];
    
    [self addSubview:bottomLine];
    [self addSubview:topLine];

}



- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
